package org.example.test;

import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @Auther: Administrator
 * @Date: 2021/9/6 14:19
 * @Description:
 */
public class Sunday {
    public static void main(String[] args) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        LocalDate localDate = LocalDate.of(2021, 1, 2);
        List<String> dateList = new ArrayList<>();

        while (localDate.isBefore(LocalDate.now())) {
            System.out.println(localDate.toString());
            System.out.println(localDate.minusDays(-1L).toString());
//            dateList.add(simpleDateFormat.format(localDate));
//            dateList.add(simpleDateFormat.format(localDate.minusDays(1L)));
            localDate = localDate.minusDays(-7L);
        }
        System.out.println(dateList);
    }
}

